Used to determine the data type of a variable.
Syntax |
|---|
|
result = VarType( value ) |
Parameters |
||
|---|---|---|
|
value |
Value to be typed. |
|
Return Value |
||
|---|---|---|
|
Result |
Indicates the data type of value. |
|
Notes
Result takes on the following values:
Result | Variant Class Constant | Description |
|---|---|---|
0 |
TypeNil |
|
2 |
TypeInteger |
Integer types of 32 bits or less, signed or unsigned. |
3 |
TypeLong |
|
4 |
TypeSingle |
|
5 |
TypeDouble |
|
6 |
|
Currency |
7 |
TypeDate |
|
8 |
TypeString |
|
9 |
TypeObject |
|
11 |
TypeBoolean |
|
16 |
TypeColor |
Please note that some earlier versions of REALbasic returned 13 for Object.
Example
The following line of code returns 8 (data type of String):
See Also
Variant class, Boolean, Byte, Color, Double, Int16, Int32, Int64, Int8, Integer, Single, String, UInt16, UInt32, UInt64, UInt8 data types; IsNumeric function.